<?php echo $this->Form->create('ProductProperty', array('id' => 'ProductPropertiesForm')); ?>
<table class="form-table" id="properties-table">
	<?php foreach($properties as $i => $property){ ?>
		<tr>
			<td class='l-style'><?php echo $property['name'] ?></td>
			<td class="r-style width_middle">
					<?php echo $this->Form->input('ProductProperty.' . $i . '.value', array('label' => false, 'class' => str_replace(";", " ", $property['constraint']))) ?>
					<?php echo $this->Form->hidden('ProductProperty.' . $i . '.property_id', array('value' => $property['id'])) ?>
					<?php echo $this->Form->hidden('ProductProperty.' . $i . '.product_id', array('value' => $this->request->data['Product']['id'])) ?>
					<?php echo $this->Form->hidden('ProductProperty.' . $i . '.id') ?>
			</td>	
			<td class="action-cm3" style="background:#FFF;"><a href="#" onclick="removed(this);" class = "act-lk del-link"><?php echo __('Delete') ?></a></td>
		</tr>
	<?php } ?>
	</tr>
</table>
<table class="form-table">
	<tr>
		<td class='l-style no-border no-background'>
			(<span class='red-star'>*</span>) <?php echo __('Required') ?>
		</td>
		<td class="r-style actions no-border no-background" style="line-height: 35px;">
			<?php echo __($this->Form->submit(__('Save'), array('id' => 'submit_product_properties', 'class' => 'submit-more'))); ?> 
			<span>or&nbsp;&nbsp;<a href="#" id="add-more-property" class="act-lk select-link"><?php echo __('Select from Prototype') ?></a></span>
		</td>
</table>
<?php echo $this->Form->end(); ?>
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery("#ProductPropertiesForm").validate();
		jQuery(".datepicker").datepicker();
	});
</script>
